package com.flame.shapeville.service;

import com.flame.shapeville.bean.Course;
import com.flame.shapeville.util.DbConnector;

import java.util.List;

/**
 * Service class responsible for managing course data.
 * <p>
 * Provides functionality to load all available courses from the database.
 *
 * @author Flame Dev Team
 * @version 1.0
 * @since 2025-05-08
 */
public class CourseService {
    /**
     * Database connector for Course data.
     */
    private final DbConnector<Course> courseDAO;

    /**
     * Constructs a new CourseService instance.
     * Initializes the database connector for Course.
     */
    public CourseService() {
        courseDAO = new DbConnector<>("db/Course.yml", Course.class);
    }

    /**
     * Loads all available courses from the database.
     *
     * @return List of Course objects
     */
    public List<Course> loadCourse() {
        return courseDAO.queryAll();
    }
}
